package com.lhb.boyixue.user.controller;

import com.lhb.boyixue.base.UnifyResponseObject;
import com.lhb.boyixue.user.model.LoginRequest;
import com.lhb.boyixue.user.model.LoginResult;
import com.lhb.boyixue.user.model.setGradeAndTimeModel;
import com.lhb.boyixue.user.service.impl.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 86131
 * @version 1.0
 * @description 用户相关接口
 * @date 2025/5/23 上午10:18
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    UserServiceImpl userService;

    @PostMapping("/login")
    public UnifyResponseObject<LoginResult> login(@RequestBody LoginRequest loginRequest) {
        LoginResult loginResult = userService.login(loginRequest);
        return UnifyResponseObject.success(loginResult);
    }
    @PostMapping("/setGradeAndTime")
    public UnifyResponseObject<setGradeAndTimeModel> setGradeAndTime(setGradeAndTimeModel setGradeAndTimeModel)
    {
       setGradeAndTimeModel model = userService.setGradeAndTime(setGradeAndTimeModel);
       return UnifyResponseObject.success(model);
    }


}
